package com.ruoyi.facilities.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.facilities.mapper.FacilitiesMapper;
import com.ruoyi.facilities.domain.Facilities;
import com.ruoyi.facilities.service.IFacilitiesService;

/**
 * 公寓配套设施管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-10
 */
@Service
public class FacilitiesServiceImpl implements IFacilitiesService
{
    @Autowired
    private FacilitiesMapper facilitiesMapper;

    /**
     * 查询公寓配套设施管理
     *
     * @param facilityId 公寓配套设施管理主键
     * @return 公寓配套设施管理
     */
    @Override
    public Facilities selectFacilitiesByFacilityId(Long facilityId)
    {
        return facilitiesMapper.selectFacilitiesByFacilityId(facilityId);
    }

    /**
     * 查询公寓配套设施管理列表
     *
     * @param facilities 公寓配套设施管理
     * @return 公寓配套设施管理
     */
    @Override
    public List<Facilities> selectFacilitiesList(Facilities facilities)
    {
        return facilitiesMapper.selectFacilitiesList(facilities);
    }

    /**
     * 新增公寓配套设施管理
     *
     * @param facilities 公寓配套设施管理
     * @return 结果
     */
    @Override
    public int insertFacilities(Facilities facilities)
    {
        return facilitiesMapper.insertFacilities(facilities);
    }

    /**
     * 修改公寓配套设施管理
     *
     * @param facilities 公寓配套设施管理
     * @return 结果
     */
    @Override
    public int updateFacilities(Facilities facilities)
    {
        return facilitiesMapper.updateFacilities(facilities);
    }

    /**
     * 批量删除公寓配套设施管理
     *
     * @param facilityIds 需要删除的公寓配套设施管理主键
     * @return 结果
     */
    @Override
    public int deleteFacilitiesByFacilityIds(Long[] facilityIds)
    {
        return facilitiesMapper.deleteFacilitiesByFacilityIds(facilityIds);
    }

    /**
     * 删除公寓配套设施管理信息
     *
     * @param facilityId 公寓配套设施管理主键
     * @return 结果
     */
    @Override
    public int deleteFacilitiesByFacilityId(Long facilityId)
    {
        return facilitiesMapper.deleteFacilitiesByFacilityId(facilityId);
    }

    @Override
    public String getFacilityNameById(Long facilityId) {
        return facilitiesMapper.getFacilityNameById(facilityId);
    }

    @Override
    public int getFacilityIdByName(String facilityName) {
        return facilitiesMapper.getFacilityIdByName(facilityName);
    }
}
